<script setup lang="ts">
import ImgInfo from './imgInfo.vue';
import DocInfo from './docInfo.vue';
import Member from './member.vue';
import Case from './case.vue';

interface Props {
  fileData?: any[];
  thirdType?: number;
  thirdParentId?: number;
}

const props = withDefaults(defineProps<Props>(), {
  fileData: () => [],
  thirdType: 0,
  thirdParentId: 0
});

const emit = defineEmits(['updateFile']);

function refresh(id: any, searchParams: any) {
  // 刷新列表
  emit('updateFile', id, searchParams);
}
</script>

<template>
  <!-- 图片库 -->
  <ImgInfo v-if="thirdType === 1" :file-data="fileData" :third-parent-id="thirdParentId" @refresh="refresh" />
  <!-- 人员 -->
  <Member v-else-if="thirdType === 2" :file-data="fileData" :third-parent-id="thirdParentId" @refresh="refresh" />
  <!-- 案例 -->
  <Case v-else-if="thirdType === 3" :file-data="fileData" :third-parent-id="thirdParentId" @refresh="refresh" />
  <!-- 文档 -->
  <DocInfo v-else :file-data="fileData" :third-type="thirdType" :third-parent-id="thirdParentId" @refresh="refresh" />
</template>

<style scoped lang="scss"></style>
